using UnityEngine;
using System.Collections;
using System;

public class ConnectionGUI : MonoBehaviour {
	
	public string IP = "127.0.0.1";
	public int Port = 25001;
		
	void OnGUI () {
		if (Network.peerType == NetworkPeerType.Disconnected){
			if(GUI.Button(new Rect(100,125,100,25),"Start Server")){
				Network.InitializeServer(10,Port);
			}
		} else {
			if(Network.peerType == NetworkPeerType.Server){
				GUI.Label(new Rect(100,100,100,25), "Server");
				GUI.Label(new Rect(100,125,100,25), "Connections: " + Network.connections.Length);
				
				if(GUI.Button(new Rect(100,150,100,25), "Logout")){
					Network.Disconnect(250);
				}
			}	
		}
	}
	
			
}
